<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.6.xsd">

    <changeSet id="create-table-user_profiles" author="divanov">
        <createTable tableName="user_profiles">
            <column name="id" type="uuid" remarks="Идентификатор профиля пользователя">
                <constraints nullable="false" primaryKey="true"/>
            </column>
            <column name="name" type="varchar(50)" remarks="Имя">
                <constraints nullable="false"/>
            </column>
            <column name="lastname" type="varchar(100)" remarks="Фамилия">
                <constraints nullable="false"/>
            </column>
            <column name="description" type="varchar(2000)" remarks="Описание профиля"/>
            <column name="photo" type="bytea" encoding="none" remarks="Фотография профиля"/>
            <column name="user_id" type="uuid" remarks="Идентификатор пользователя">
                <constraints nullable="false" foreignKeyName="fk_user-profile_id_user_id" references="users(id)"/>
            </column>
        </createTable>
    </changeSet>

</databaseChangeLog>
